<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript">
    /*
      function User(name, pass)
      {
        this.name = name;
        this.pass = pass;
      }

      User.prototype.showName = function(){
        alert(this.name);
      };
      User.prototype.showPass = function()
      {
        alert(this.pass);
      };
*/
      class User {
        constructor(name,pass) {
          this.name = name;
          this.pass = pass;
        }

        showName(){
          alert(this.name);
        }

        showPass(){
          alert(this.pass);
        }

      }

      class VIPUser extends User {
        constructor(name,pass,level) {
          super(name,pass);
          this.level = level;
        }

        showLevel()
        {
          alert(this.level);
        }

      }

      var u = new VIPUser('albert','123',3);
      u.showName();
      u.showPass();
      u.showLevel();

    </script>
  </head>
  <body>

  </body>
</html>
